package com.cskaoyan.bean;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author stone
 * @date 2022/12/20 10:43
 */
public class LifeCycleBean2 implements ApplicationContextAware {

    ApplicationContext applicationContext;

    public LifeCycleBean2() {
        System.out.println("bean2的实例化");
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("bean2的setApplicationContext方法");
        // 传入容器
        this.applicationContext = applicationContext;
    }
}
